package com.rabbitmq.demo.dlx;

import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;

import java.util.Queue;

public class Sender {

    @Autowired
    private  RabbitTemplate rabbitTemplate;

    @Autowired
    private Queue queue;

    @Scheduled(fixedDelay = 1000, initialDelay = 500)
    public void send(){
        rabbitTemplate.convertAndSend("msg.directExchange","msg","Hello,dlx!");
    }
}
